package org.dromara.common.signature.config;

import org.dromara.common.redis.config.RedisConfiguration;
import org.dromara.common.signature.core.aop.ApiSignatureAspect;
import org.dromara.common.signature.core.redis.ApiSignatureRedisDAO;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

/**
 * HTTP API 签名的自动配置类
 *
 * @author Zhougang
 */
@AutoConfiguration(after = RedisConfiguration.class)
public class ApiSignatureAutoConfiguration {

    @Bean
    public ApiSignatureAspect signatureAspect(ApiSignatureRedisDAO signatureRedisDAO) {
        return new ApiSignatureAspect(signatureRedisDAO);
    }

    @Bean
    public ApiSignatureRedisDAO signatureRedisDAO() {
        return new ApiSignatureRedisDAO();
    }

}
